package com.helen.adapter;

import android.text.TextUtils;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.helen.entity.HelpListEntity;
import com.helen.entity.HelpListEntity;
import com.helen.shopping.R;
import com.helen.utils.MyLog;

import java.util.List;


/**
 * Created by yang on 2018/5/2.
 */

public class HelpOrderListAdapter extends BaseQuickAdapter<HelpListEntity, BaseViewHolder> {
    public HelpOrderListAdapter(int layoutResId, List<HelpListEntity> data) {
        super(layoutResId, data);

    }


    @Override
    protected void convert(final BaseViewHolder helper, final HelpListEntity item) {
        try {
            TextView tvTitle = (TextView) helper.getView(R.id.tv_title);
            TextView tvGoodName = (TextView) helper.getView(R.id.tv_good_name);
            TextView tvWx = (TextView) helper.getView(R.id.tv_wx);
            TextView tvNum = (TextView) helper.getView(R.id.tv_num);
            tvTitle.setText("求助标题: " + item.getTitle());
            tvGoodName.setText("求助物品: " + item.getType());
            if(!TextUtils.isEmpty(item.getWx())){
                tvWx.setText("微        信: " + item.getWx());
            }
            tvNum.setText("数        量: " + item.getCount());
        } catch (Exception e) {
            MyLog.e("yang", "设置帮助订单列表异常" + e.toString());
        }

    }
}